import { createRouter, createWebHashHistory, Router } from 'vue-router';
import { RouteConfig } from 'vue-router';
const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'HomeView',
    component: () => import('@/views/HomeView.vue'),
    children: []
  },
  {
    path: '/map',
    name: 'MapView',
    component: () => import('@/views/BaiduMap.vue'),
    children: []
  },
  {
    //vue-router <3x
    //path:"*",
    //vue-router 4x的写法
    path: '/:pathMatch(.*)/',
    // redirect: "/notfound", //重定向
    redirect: {
      // paht: "/notfound",
      name: 'HomeView'
    }
  }
];
const router: Router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
